<div class="gadget" style="padding: 0px; margin: 0px;">
	<div class="linklist">
		<div class="linklist_title">
			<h3>{$title}</h3>
		</div>    
	</div>
</div>
<div class="widget">
	<ul class="widgetList" id="cur_exchange">
		<li class="odd">
			<a href="http://piyasa.com/dolar" target="_blank">
				<span class="dd">
					<img src="http://piyasa.com/img/icons/usd.png" alt="">
					<strong>USD</strong>
					<img src="http://piyasa.com/img/icons/pause.gif" alt=""> %0.000
				</span>
				<span class="as"><span class="a">Alış</span>: 1.8530TL</span>
				<span class="as"><span class="s">Satış</span>: 1.8540TL</span>
			</a>
		</li>
		<li class="even">
			<a href="http://piyasa.com/euro" target="_blank">
				<span class="dd">
					<img src="http://piyasa.com/img/icons/eur.png" alt="">
					<strong>EUR</strong>
					<img src="http://piyasa.com/img/icons/pause.gif" alt=""> %0.000
				</span>
				<span class="as"><span class="a">Alış</span>: 2.3030TL</span>
				<span class="as"><span class="s">Satış</span>: 2.3040TL</span>
			</a>
		</li>
		<li class="odd">
			<a href="http://piyasa.com/sterlin" target="_blank">
				<span class="dd">
					<img src="http://piyasa.com/img/icons/gbp.png" alt=""> 
					<strong>GBP</strong> 
					<img src="http://piyasa.com/img/icons/down.gif" alt=""> %-0.070
				</span>
				<span class="as"><span class="a">Alış</span>: 2.8440TL</span>
				<span class="as"><span class="s">Satış</span>: 2.8590TL</span>
			</a>
		</li>
	</ul>
</div>

<script language="javascript">
	function _ab_UpdateCurencyExchange(){ldelim}
		str = 'http://piyasa.com/json/doviz_guncel_akba.json';
		jQuery.ajax({ldelim}
			type: "POST",
			dataType: 'json',
			url: str, 
			success: function(data){ldelim}
				// build html
				var row_mode = "even";
				var ret_html ="";
				for (var i=0; i<data.length; i++)
				{ldelim}
					var item = data[i];
					if ((item.foex == "USD") || (item.foex == "EUR") || (item.foex == "GBP"))
					{ldelim}
						// turn row
						if (row_mode == "even")
							row_mode="odd";
						else
							row_mode = "even";
						
						var html = "<li class='"+row_mode+"><a href='javascript:void(0);' target='_blank'>";
						html+="<span class='dd'>";
						// flag
						html+="<img src='http://piyasa.com/img/icons/"+item.foex.toLowerCase()+".png'> ";
						
						html+="<strong>"+item.foex+"</strong>"; 
						
						html+="<img src='";
						
						item.change2 = parseFloat(item.change );
						if (item.change2 > 0)
						{ldelim}
						 html+="http://piyasa.com/img/icons/up.gif";   
						{rdelim}
						else if (item.change2 < 0)
						{ldelim}
							html+="http://piyasa.com/img/icons/down.gif";
						{rdelim}
						else
						{ldelim}
							html+="http://piyasa.com/img/icons/pause.gif";
						{rdelim}
						html+="' > % "+item.change;
				
				html+="</span>";
				html+="<span class='as'><span class='a'>{$_TR.buy}</span>: "+item.buy+"TL</span>";
				html+="<span class='as'><span class='s'>{$_TR.sell}</span>: "+item.sell+"TL</span>";
			html+="</a></li>";
						
						ret_html +=html;
					{rdelim}
					// end if in for
				{rdelim}
				// end for
				jQuery("#cur_exchange").html(ret_html);
			{rdelim} 
		{rdelim}); 
		setTimeout("_ab_UpdateCurencyExchange();",5000);
	{rdelim}
	
	jQuery(document).ready(function(){ldelim}
        _ab_UpdateCurencyExchange();
		setTimeout("_ab_UpdateCurencyExchange();",500);
	{rdelim});
</script>